#include "comm.hpp"
int main()
{


    int shmid = GetShm();
    char* shmaddr = (char*)shmat(shmid, nullptr, 0);

    int fd = open(FIFO_FILE, O_WRONLY);


    //ipc code

    //一旦有了共享内存，挂接到字节的地址空间中，我们直接把它当成我们的内存空间来用即可！
    //不需要系统调用
    while(true)
    {
        cout << "Please Enter@";
        fgets(shmaddr, 4096, stdin);
        write(fd,"c", 1);//通知对方

    }


    shmdt(shmaddr);
    close(fd);
    return 0;
}